-
Notifications
You must be signed in to change notification settings - Fork 18
Support Windows #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Support Windows #33
Conversation
So, the notify that is in here already should actually be correct. I think the issue my lie in the way service.pp or config.pp is applied on Raspbian. Can you post the output of |
With Facts:
|
@mxzinke What version of Puppet? |
manifests/service.pp
Outdated
enable => $promtail::service_enable, | ||
require => Systemd::Unit_file['promtail.service'], | ||
enable => $promtail::service_enable, | ||
active => $promtail::service_ensure == 'running' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love the syntax <3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not familiar with this syntax @bastelfreak, what does it do and why do you <3 it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe because it's readable?
manifests/service.pp
Outdated
class promtail::service { | ||
case $facts['kernel'] { | ||
'Linux': { | ||
include systemd::systemctl::daemon_reload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this resource is gone in latest releases of the systemd module. The module now requires puppet 6.1 or newer because that version contains the automatic systemctl daemon-reload und changed/new unit files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module already states 6.1 as the bottom end so I think removing this would make sense.
@mxzinke I need a couple of things:
Also, still wondering what version of puppet you are running. |
@mxzinke which version of the systemd module do you have in your environment and which puppet version are you on? And you use systemd, right (the code really looke like it but the error message sounds so much like sysv)? as mentioned in the inline comment, camptocamp/systemd dropped the exec resource which does a to make this a bit more confusing, after the release the module got migrated to Vox Pupuli. To work properly you need the latest camptocamp module and puppet 6.1 or newer. I assume you've a combination of an older systemd module and/or puppet. I'm not aware of any issues with the latest version + puppet 6.1 so the code changes shouldn't be required, but I also think it's a good cleanup and the service should be managed through systemd::unit_file (as long as the promtail isn't installed from a package). |
Puppet Version 6.23 |
manifests/init.pp
Outdated
Hash $positions_config_hash, | ||
Hash $scrape_configs_hash, | ||
Stdlib::Absolutepath $bin_dir, | ||
Stdlib::Absolutepath $bin_dir = promtail::params::bin_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my personal opinion is that instead of adding a params.pp, hiera in modules should be used (but I'm not a maintainer here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, please move this to the existing in module data. I will comment below with some pointers in case this is not something you have done before (no disrespect intended if you have, just trying to help)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice. If you could do it. Also would be nice if you could have a look at the windows service thing, it seems to not work correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I absolutely love that you are adding Windows support, but that work also needs to be its own PR, not added onto this one.
Regarding this PR, @bastelfreak brought up in #33 (comment) that your issue might well be related to the version of the systemd module you are using. Does that line up at all with what you have locally?
manifests/init.pp
Outdated
Hash $positions_config_hash, | ||
Hash $scrape_configs_hash, | ||
Stdlib::Absolutepath $bin_dir, | ||
Stdlib::Absolutepath $bin_dir = promtail::params::bin_dir, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, please move this to the existing in module data. I will comment below with some pointers in case this is not something you have done before (no disrespect intended if you have, just trying to help)
'Linux': { | ||
$bin_dir = '/usr/local/bin' | ||
$data_dir = '/usr/local/promtail_data' | ||
$config_dir = '/etc/promtail' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These items belong in data/kernel/Linux.yaml
$bin_dir = 'C:\\Program Files\\promtail' | ||
$data_dir = "${bin_dir}\\versions" | ||
$config_dir = "${bin_dir}\\config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These items belong in data/kernel/windows.yaml
Sorry, I actually worked with my fork and forgot to change the branch. The original issue is actually gone. So may we just change the title and work on the Windows Support. It's actually needed soon.
The solution for my issue was to set the correct default provider. |
Just to tell one more time and to not confuse: The original problem resolved by setting a correct default service provider. (to systemd) I changed the title of the PR to now supporting windows. Sorry for switching topics, but I am really in a hurry and sometimes you mess things up |
Maximilian Zinke seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
# @param [Stdlib::Absolutepath] bin_dir | ||
# The directory in which to create a symlink to the promtail binary | ||
# | ||
# @param [Stdlib::Absolutepath] config_dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since newer puppet-strings releases, you don't have to provide the datatype here, puppet-strings will read it from the actual code
# | ||
# Sets default variables per OS | ||
# | ||
# @api private |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if this class is private I suggest adding assert_private()
to the code
@bastelfreak In case this topic is still in your interest, please go on. I've no time for managing bringing the change into the project. Sorry. |
Supporting Windows: